package thread;

import java.util.Scanner;

public class SleepDemo {
    public static void main(String[] args)  {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入数字");
        int s=sc.nextInt();
        for(int i=1;i<=s;i++){try {
            System.out.println(i);
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        }
        System.out.println("程序结束了\n"+"main方法结束");
    }
}